package com.example.demo2_review.design_pattern.structural_patterns.adapt_pattern;

import static com.example.demo2_review.pojo.common.BaseConstants1.*;

/**
 * @Author zwp14
 * @create 2024/6/24 20:16
 * @description 媒体实现
 */
public class MediaAdapterServiceImpl implements MediaPlayerService {

    AdvanceMediaPlayerService advanceMediaPlayerService;


    @Override
    public void play(String audioType, String fileName) {

        if (STR_VLC.equalsIgnoreCase(audioType)){
            this.advanceMediaPlayerService = new VlcPlayerService();
            advanceMediaPlayerService.playVlc(fileName);
        }else if (STR_MPC.equalsIgnoreCase(audioType)){
            this.advanceMediaPlayerService = new MpcPlayerService();
            advanceMediaPlayerService.playMpc(fileName);
        }else if (STR_AVI.equalsIgnoreCase(audioType) ){
            System.out.println("Play AVI file.Name:" + fileName);
        }else if (STR_MP4.equalsIgnoreCase(audioType)){
            System.out.println("Play MP4 file.Name:" + fileName);
        }
    }
}
